#include <iostream>
#include <sys/mman.h>
#include<errno.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
using namespace std;

int main(){
	int fd = open("/dev/zero",O_RDWR);
	char *area = (char*)mmap(NULL,1024,PROT_READ|PROT_WRITE,MAP_SHARED,fd,0);
	
	int *myInt = (int*)mmap(NULL,1024,PROT_READ|PROT_WRITE,MAP_ANONYMOUS|MAP_PRIVATE,0,0);
	if(area == NULL){
		cout << "error" << endl;
		cout << strerror(errno);
	}
	cout << "hello" << endl;
	strcpy(area,"hello"); 
	cout << "Hello" <<endl;
	cout << area << endl;
	cout << *area << endl;
	*myInt = 20; 
	cout << *myInt <<endl;

	
}
